package org.xy.yq.dao;

import org.apache.ibatis.annotations.*;
import org.xy.yq.entity.User;
import java.util.List;

public interface IUserDao {
    //注册功能
    @Insert("insert into user(username,password,state) values(#{username},#{password},#{state})")
    void register(User user);
    //登录功能
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(@Param("username") String username,@Param("password") String password);
    @Select("select * from user")
    List<User> selectAll();
    @Delete("delete from user where id=#{id}")
    void deleteById(int id);
    @Update("update user set state=#{state} where id=#{id}")
    void updateUser(User user);
}
